import React, { useState } from 'react';

export const DateFn: React.FC = () => {
    const [date] = useState(() => {
        const dt = new Date();
        return { year: dt.getFullYear(), month: dt.getMonth() + 1, day: dt.getDate() }
    });
    return (
        <>
            <h1>当前日期：</h1>
            < h2>{date.year}年{date.month}月{date.day}日</h2>
        </>
    )
}


